package com.heima.service;
import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

@AiService(wiringMode = AiServiceWiringMode.EXPLICIT,
        chatModel = "openAiChatModel",    //配置聊天模型
        streamingChatModel = "openAiStreamingChatModel",  //配置流式聊天模型
        chatMemoryProvider = "chatMemoryProvider",  //配置会话记忆提供者
        contentRetriever = "contentRetriever"//配置向量数据库检索对象
)
public interface AiChatService {
    //用于聊天的方法,message为用户输入的内容
    @SystemMessage(fromResource = "system.txt")
    public Flux<String> chat(@MemoryId String memoryId,@UserMessage String message);


}
